<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<style>
.editor table {
	display: inline;
	vertical-align: top;
}
</style>
<div class="r_location">
	<i class="r_txtico"></i> 内容管理&gt; 产品类型 &gt; 新建产品类型
</div>
<form id="add_form" action="cms/productType/add" method="post">
	<ul class="all_list">
		<li>
			<span class="all_title">类型名称：</span>
			<span>
				<input class="ui_input" id="name" validator='{"label":"名称","isDigit":false,"minLength":1,"maxLength":50}'  name="name" style="width:100px;">
			</span>
		</li>
		<li>
			<span class="all_title">类型名称：</span>
			<span>
				<input class="ui_input" id="type" validator='{"label":"类型","isDigit":false,"minLength":1,"maxLength":50}'  name="type" style="width:100px;">
			</span>
		</li>
		<li><span class="all_title"></span> <span> <input
				type="button" id="viewBtn" value="预览" onclick="preView()"
				class="btn_blue m-r15"> <input type="button"
				id="addBtn" value="提交" class="btn_blue m-r15 submitBtn">
		</span></li>
	</ul>
</form>
<script type="text/javascript">
    
	
	$(function() {
		$("#add_form").validator({}, {
			callback : function(data) {
				if (!$('#name').val()) {
					alert("名称不能为空");
					return false;
				} 
				if (!$('#type').val()) {
					alert("类型不能为空");
					return false;
				}
				$("#add_form").ajaxSubmit(function(data) {
					if (data.success == 'succeed') {
						art.dialog({
							icon : data.success,
							content : data.message,
							lock : true
						}).time(1);
						to_page('/cms/productType/view/page');
					} else {
						art.dialog({
							icon : data.success,
							content : data.message,
							lock : true
						});
					}
				});
			}
		});

	});
</script>